<%@page contentType="text/html;charset=utf-8"%>
<%@include file="../../core/common.jsp"%>
<html>
<head>
<title></title>
</head>
<script>
	function cpxh_(newValue, oldValue) {
		if (newValue) {
			$('#fm').form('load', '${CTX}/app/core/rkdmx/get/${param.id}/' + newValue);
		} else {
			location.reload();
		}
	}
</script>
<body>
	<div class="easyui-panel" data-options="fit:true,border:false,footer:'#fb'">
		<form id="fm">
			<table class="form-layout w90 p-t-10 p-r-30">
				<tr>
					<td>产品编号：</td>
					<td><input name="cpbh" class="easyui-textbox" data-options="required:true" validType="maxLength[50]" readonly="readonly" value="${param.id}" /></td>
				</tr>
				<tr>
					<td>产品序号：</td>
					<td><input name="cpxh" class="easyui-combobox" data-options="url:'${CTX}/mgt/t/rkd/kccpxh/${param.id}',editable:false,formatter:'',required:true,onChange:cpxh_" /></td>
				</tr>
				<tr>
					<td>重量：</td>
					<td><input name="zl" class="easyui-textbox" data-options="required:true,disabled:true" /></td>
				</tr>
				<tr>
					<td>块数：</td>
					<td><input name="ks" class="easyui-combobox" data-options="url:'${CTX}/mgt/sys/dict/option/ks',editable:false,formatter:'',required:true" /></td>
				</tr>
			</table>
		</form>
	</div>
	<div id="fb">
		<a id="save" class="form-btn success">确定</a>
	</div>
</body>
<script>
	$(function() {
		$('#save').hide();
		$('#save').click(function() {
			if (!$('#fm').form('validate')) {
				return;
			}
			$.mask();
			$.ajax({
				url : '${CTX}/mgt/t/rkd/xgrkmx',
				data : $('#fm').serialize(),
				success : function(data) {
					$.unmask();
					$.handle(data, function() {
						$.close();
					});
				}
			});
		});
		$('#fm').form({
			onLoadSuccess : function() {
				$.unmask();
				$('#save').show();
			}
		});
	});
</script>
</html>